package com.canaan.business.common.enums.storehouse;

/**
 * 仓库状态枚举
 */
public enum StorehouseStockStatusEnum {

    NORMAL("NORMAL", "正常-可用可动"),
    LOCK("LOCK", "锁定-不可用不可动"),
    FREEZE("FREEZE", "冻结-不可用可动"),
    POOR("POOR", "不良品"),
    RETURNED("RETURNED", "退货品");

    private final String code;
    private final String message;

    StorehouseStockStatusEnum(String code, String info)
    {
        this.code = code;
        this.message = info;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(String code) {
        if (code == null) {
            return null;
        }
        String message = null;
        for (StorehouseStockStatusEnum value : values()) {
            if (value.getCode().equals(code)) {
                message = value.getMessage();
                break;
            }
        }
        return message;
    }
}
